#ifndef __KT_SYS__
#define __KT_SYS__	 

#include <stdint.h>
#include <stdio.h>
#include "highdata.h"

#define dbg printf

#define myarg(n) dbg("%s = %d\r\n", #n, n)
#define myargx(n) dbg("%s = %x\r\n", #n, n)
#define myargc(val) ({\
    static uint32_t old_val = 0;\
    uint32_t current_val = (uint32_t)(val);\
    if(current_val != old_val) {\
        tlog("%s = %d\r\n", #val, current_val);\
    }\
    old_val = current_val;\
})
#define KT_CHECK(val) ({\
        static uint8_t old_val = 0;\
        uint8_t ret = 0;\
        uint8_t current_val = (uint8_t)(val);\
        if(current_val != old_val) {\
            ret = current_val ? 1 : 2;\
        }\
        old_val = current_val;\
        ret;\
    })



#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))

void print_array(uint8_t *buf, uint16_t len);
#define dtplus_dvalve_set(n)
uint16_t u16_h_convert_val(uint8_t *d);


#endif

